Digisalt

 o

nline >> 

tools

 >> 

SNES palette tools tutorial

 >> 

This is an archived version of http://flobo2000.fl.funpic.de/tools/paltools/e_manual.html. Frozen into zip 3/19/06 for Romhacking.net's archive.

SNES Palette tools - the official manual

document v1.0 by FloBo - ©2005

Hello there and welcome to the official manual for Digisalts SNES Palette tools. As handling commandline-programs without any documentation may be a bit difficult, I created this little manual, to show you the way you have to use these tools. As well, I'll show up some of the major advantages of the tools compared to the Win-program SNES Palette Editor (I'm referring to version 0.3 which is the latest... as far as I know). So let's get started...


1. Why I wrote those tools...

First of all, those tools are all about palette-editing... did I mention this before?! :P
Anyway the point why I created the tools, was that I found it very annoying to edit SNES-graphics (Tilesets, yay^^) without having the original colored tiles in front of me. Of course, you can take a screenshot of your tiles and adjust the palette of your Tileeditor (mine is Tile Layer Pro...) so they match more or less... but what if you want to change the palette-data itself? Alright, there's this tool called SNES Palette Editor, I used for quite some time as well. But editing each single color with this tool also annoyed me a bit cause you don't see the effect of the changes you made until you ran your modified rom in an emulator. That's one reason. Another one is, that if you're searching for the palette, you are willing to change using the search-function of SNES Palette Editor, you get perhaps a thousand results for your search because the programm just searches for ONE single color out of 15 available ones, the SNES stores in the palette.
With my tools, I wanted to improve all this, so that palette editing may become something like editing the levels of Super Mario World... something even dumb people can do^^


2.0 Finding the palette, you want to change...

As already mentioned, I found searching for palette-data with SNES palette editor very annoying. Also there were quite some noobs who had trouble using the search-function of SNES palette editor. So I decided to write an own Palette-finding-tool. And: *da-daradaaa* here it is!! The ultimate palette-searching util! It is called Digisalts SNES palette searcher!!! With this tool, you do not have to type any color-values, you want to search. You simply take a screenshot of a single modified tile, you want to edit, save it as an ordinary Windows-bitmap (24bit) and let the palette-searcher do its job. It will produce a logfile containing all the offsets, where your palette may be stored (in most cases exactly ONE single offset, in some special ones also more...).

2.1 Preparing the tile of your choice

As it may be a bit complicated (for a non-native speaker) explaining how to use my tools, I will use a case-study to show you how to handle my tools. Therefore, make sure you've got a... uhmmm... a F-Zero-rom right in front of you (Do not ask me where to get this rom. USE GOOGLE!). I'm referring to the US-NTSC-version of the game. So make sure you don't a japanese or whatever crap-version. It should be 512KB large (romheader included). So let's say, we want to change the colors used by the F-Zero-logo on displayed on the titlescreen. In doing this, you can give the title a slightly new look with in doing simple palette-editing. So first of all, we want to find out, where the palette for those tiles is stored. Therefor, we open the F-Zero-rom in a tile-editor. I prefer Tile Layer Pro because it's a full featured tile-editor without too much useless crap around (also it's a good advice to use it because my palette-extractor creates tile-layer-pro-compatible palette-files...). Having opened the rom, you should scroll down until you see something looking like the tiles, we want to change (shown at picture no. 1).

Actually, the default colors, used by Tile-Layer Pro aren't very nice, but that shouldn't matter now, cause that's exactly what we're just gonna change. Now we need to edit one of the tiles, so we can find out the palette, the tiles uses. Therefor, we're gonna edit the upper-left tile of the Logo (marked pink here). Simply click on the tile and it will appear in the Tile-editing-box on the lower right. The next thing to do is filling the tile-with all colors available. You must use the correct order of colors like I used in this example, to produce a palette, compatible with my tools. So just go ahead, select the most leftern color of the upper row and paint the first half of the column in the editor with this color. After that go get the color next to it and paint another four pixels. Do this until you get the exact same tile shown in picture no. 2.

As you can see, we simply painted all available colors in a special order into the tile. You may also have noticed that every change in the editor-part of tile-layer pro has changed in the overview in the upper-left as well. That means, you actually changed the rom... well not yet. You still can close and discard, but that's not what we wanna do now. Just go and save the rom with another name than the original one (This change is only done to rip the palette from the rom. I suppose, you don't want a screwed Logo in your final hack...). I saved it as 2test.smc.
Next, go to your snes-emulator and run the game. Note: You MUST use ZSNES because SNES9X seems to emulate the SNESs colors not correctly. Therefor it is NOT usable in this case. Maybe that other SNES-emulators are also suitable for this but I haven't tested them...
When starting the 2test.smc, you should now see something like this:

The upper-left corner of the title now shows you the whole palette, used by this tile... Yet we don't just want to watch the palette, but locate it in the rom. To do this, we have to create a new 24-bit bitmap containing only the single tile, we just editied. The new bitmap can have three different dimensions. 8x8 pixels, 8x4 pixels or 8x2 pixels. You can choose which format you prefer... This is how it should look like:

Finally save this bitmap as "palette.bmp" to the same directory, where you already saved your F-Zero-rom to (in my case, it was E:\ProgX\Palettetools\). Note: it is very important, that the bitmaps name is palette.bmp because otherwise, the palette-searchtool won't find the file at all.

2.2. Using the Palettefinder

Next, copy the snespalfind.exe into the directory. Open a dos-prompt, navigate to the directory and type: snespalfind.exe 2test.smc. Then hit return to start the tool. The general input for this tool is:
       snespalfind.exe "Rom-filename"
Also, it needs the palette.bmp stored in the same directory. Otherwise, it'll return an error-mesage. If you did everything correctly and the tool doesn't return any errormessage, you should see some kind of progress-bar seeking up towards 100%. And finally, the tool found exactly one matching palette-entry within the rom!!! The search-results are then stored in a new file named pallog.log. It can be opened using an ordinary texteditor like notepad. Here's a shot of how the output of the tool should look like.

Now go ahead and open the pallog.log and look up the offset, where the finder has located your palette...


3. Extracting the palette

Now that we know the address of our palette, we should go on extracting the palette so we can use it with tile-layer pro. For this purpose, I created the second tool: the SNES palette extractor!! With this tool, we're able to extract the palette from a specific offset within a rom and the tool automatically converts and saves the converted palette in tile-layer pro-format onto your drive. So let's give it a try.
From our pallog.log, we learned, that our palette is located at address x7C4E0 in the rom. So we need this data as parameter for the palette-extractor. To extract our palette, we have copy the snespalex.exe into our directory and via out command prompt, we type: snespalex.exe 2test.smc x7C4E0. The general input for this tool is:
       snespalex.exe "Rom-filename" "Offset to extract from"
The following screenshot shows again the output of the program, when everything has been working correctly. One thing is really important if you extract a palette: you have to type the offset correctly! If there's just a minor mistake, the palette-extractor will create a completely different palette-file that doesn't match the palette, you've been searching for at all. So beware! Another thing of interest is this: you may use different versions of input for extracting a palette. You may type x7C4E0 or $7C4E0 to access the offset via a hexadecimal address. If you prefer using a decimal number, just type any numerical address without any prefix. In this case, you could type 509152 instead of the x7C4E0 as well. Another pic for you to watch the correct output of the tool:

Having finished these steps successfully, there should now be a new file named palette.tpl inside your directory. This is the palette-file, we can now use in tile-layer pro.


4. Modifying the palette

Alright. We extracted our palette. Back in tile-layer pro, we now can import it and view our Title in original colors!!! So we first load the original F-Zero-rom, scroll down until we see our logo again, and then import the palette.tpl. The following picture shows what it should now look like!

We can see the logo in original-ingame-colors!!! Now let's try some palette-editing! It's really easy to modify the palette now, because we can just use the color adjustment-bars at the palette-editor-part of the program. I wanted to have a red colored logo. So I set all the pink-colors' G and B-bars to zero. The result was this:

At this point, we have to save the palette again. We still have not changed the roms' internal palette-data. We only adjusted the palette.tpl-file. Now that we have saved the changes, we did to palette.tpl, we'll have to reinsert the data into our rom. How we can do this, you'll learn now...


5. Reinserting the modified palette

Coming next: the final steps!! As before, we have to use a little commad line tool to reinsert the modified palette into our rom. For this purpose, I created the SNES palette inserter. It's just some kind of opposite-program to the extractor, because it gets the same input parameters and just converts the data from the palette.tpl-file into SNES-standard-colors and reinserts them at the specified offset. So having copied the snespalin.exe into your directory, type: snespalin.exe 2test.smc x7C4E0 to reinsert the palette. The general input for this tool is:
       snespalin.exe "Rom-filename" "Offset to extract from"
If you haven't got any error-messages displayed, everything should have worked fine. Also for this step, I took a little screenshot for your visual aid:

Having done this, we've finished! Now you can enjoy your changed palette in the real game! Just run the rom in any SNES-emulator (you may even use SNES9X now. Kind of me, isn't it?!^^). Finally, you should see this new titlescreen!!!


6. That's it then...

Alright. This is the second tutorial I wrote (but the first for my self-written tools, though!) and I think it worked all fine!! Now I hope, you know how to edit palettes using my tools. If you recognize some games, where the palette-finder can't locate your palette, it is very likely, that the palette you're searching for is somewhere compressed within the rom. Finding it then is quite much more difficult if you don't know that much about SNES-internals that much. So I won't cover this topic in this tutorial. In the usual cases, you should be able to come along with my three tools. Feel free to use them. If you want to redistribute them via the internet, you may do that if you do not change any content of the archieve, you got from my site. If you have any feedback, don't hesitate to write a mail to webmaster_AT_digisalt.de. Also you can sign the guestbook or write a something into the digiboard at http://www.digisalt.de. Any feedback is welcome. If you have found any typos or grammar errors in this documentation, you may report them too.

© 2006 by Digisalt